package com.example.module_mine.mine.viewmodel

import androidx.lifecycle.MutableLiveData
import com.example.lib_common.base.BaseViewModel
import com.example.lib_net.model.api.MineModel
import com.example.module_mine.mine.repository.MineRepository
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.flow.MutableStateFlow
import javax.inject.Inject

/**
 * @author yaotianxue
 * @description
 * @date 2025/1/17
 */
@HiltViewModel
class MineViewModel @Inject constructor(private val repository: MineRepository):BaseViewModel() {


    val _userInfo = MutableLiveData<MineModel>()

    /**
     * 获得用户信息
     */
    fun getUserInfo(){
        execute(
            action = repository.getUserInfo(),
            onFinished = {
                //保存用户信息
                _userInfo.value = it.data
            }
        )
    }


}